
package common;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.e885.log.E885Logger;

/**
 * 這是一個共用的 HttpServlet, 最主要是將 method doGet() 和　doPost(), 由 method doAction() 來實做<br>
 * 
 * @author Eric.Kao(gau168.gau@msa.hinet.net)
 * @version 1.0
 * @company E885 Group
 * @copyright Copyright (c) 2001-2008
 */

public abstract class CommonHttpServlet extends HttpServlet
{
	private static final long serialVersionUID = 3174174929911229114L;

	/**
	 * get an instance of the HttpSession
	 * 
	 * @param request an instance of the HttpServletRequest
	 * @return an instante of the HttpSessoin
	 */
	protected HttpSession fetchHttpSession( HttpServletRequest request )
	{
		HttpSession session = request.getSession();

		if( session == null )
		{
			session = request.getSession( true );

			E885Logger.testLog.info( "session is rebuild" );
		}

		return session;
	}
}
